<?php
namespace app\home\controller;

class Index extends BaseController{
    //实例化

    protected $_G;
    

    public function initialize(){
        $this -> _G['webseo'] = $this -> getSEOinfo();
        $this -> _G['webinfo'] = $this -> getWebinfo();
        
        $this -> assign('_G',$this -> _G);
    }
  
    public function index()
    {
        return $this->fetch();
    }


    //底部订阅添加
    public function subscription(){
        $subscription = new Subscription();
        $data = [
            'email'=>input('email'),
            'create_time'=>time(),
            'laiyuan'=>1
        ];
        $re = $subscription->add($data);
        if($re){
            return json_echo_msg(200,'提交成功!');
        }else{
            return json_echo_msg(500,'');
        }
    }
}

